package top.jiangqiang.qianyi.common.constants;

public class GlobalConstants {
    public static final String GLOBAL_PREFIX = "qianyi";


    public static class CacheConstants {
        //存储token
        public final static String TOKEN_PREFIX = "TOKEN:";
        //存储用户退出登录时间
        public final static String USER_LOGOUT_TIME_PREFIX = "USER_LOGOUT_TIME:";
    }

    public static class SecurityConstants {
        public static final String USER_ID = "USER-ID";
        public static final String PLATFORM = "PLATFORM";
    }

    /**
     * 公共请求URL常量，不需要鉴权，前后台通用的一些接口使用的请求前缀应该在这里定义
     */
    public static class CommonRequestURLConstants {
        public static final String API_PREFIX = "/api";
        public static final String API_PREFIX_PATTERN = API_PREFIX + "/**";
        /**
         * 公共接口统一前缀
         */
        public static final String COMMON_CONTROLLER_PREFIX = CommonRequestURLConstants.API_PREFIX + "/common";
        /**
         * 公共接口拦截器使用
         */
        public static final String COMMON_ADMIN_CONTROLLER_PATTERN = COMMON_CONTROLLER_PREFIX + "/**";
        /**
         * 文件上传下载控制器统一前缀
         */
        public static final String COMMON_FILE_CONTROLLER_PREFIX = COMMON_CONTROLLER_PREFIX + "/file";
        /**
         * 文件公共访问接口相对路径
         */
        public static final String COMMON_FILE_ACCESS_API_PREFIX = "/access";
        /**
         * 文件公共访问接口
         */
        public static final String COMMON_FILE_ACCESS_API_FULL_PREFIX = COMMON_FILE_CONTROLLER_PREFIX + COMMON_FILE_ACCESS_API_PREFIX;

    }

    /**
     * 大部分需要鉴权，仅后台使用的接口路径
     */
    public static class AdminRequestURLConstants {
        /**
         * 后台接口统一前缀
         */
        public static final String ADMIN_CONTROLLER_PREFIX = CommonRequestURLConstants.API_PREFIX + "/admin";
        /**
         * 后台接口拦截器使用
         */
        public static final String ADMIN_CONTROLLER_PATTERN = ADMIN_CONTROLLER_PREFIX + "/**";
        /**
         * 用户控制器前缀
         */
        public static final String ADMIN_USER_CONTROLLER_PREFIX = ADMIN_CONTROLLER_PREFIX + "/adminUser";

        /**
         * 后台文件上传相关操作
         */
        public static final String ADMIN_FILE_CONTROLLER_PREFIX = ADMIN_CONTROLLER_PREFIX + "/file";
    }

    /**
     * 大部分需要鉴权，仅前台使用的接口前缀在这里定义
     */
    public static class WebsiteRequestURLConstants {
        /**
         * 前台接口统一前缀
         */
        public static final String WEBSITE_CONTROLLER_PREFIX = CommonRequestURLConstants.API_PREFIX + "/website";
        /**
         * 前台接口拦截器使用
         */
        public static final String WEBSITE_CONTROLLER_PATTERN = WEBSITE_CONTROLLER_PREFIX + "/**";
        /**
         * 用户控制器前缀
         */
        public static final String WEBSITE_USER_CONTROLLER_PREFIX = WEBSITE_CONTROLLER_PREFIX + "/websiteUser";

    }


    public static class FilterConstants {
        public static final int DEFAULT_FILTER_ORDER = 500;
    }
}
